/**
 * 获取法院层级
 * @returns
 */
export function fetchCourtLevel() {
  return import("@/mock/getGlobalTreeData.json")
    .then((res) => res.default)
    .then((res) => res.data.courtLevelStatisticVo.children)
    .then((list) =>
      list.map((item) => ({
        value: item.name,
        label: item.name,
      }))
    );
}

/**
 * 获取地域与法院
 * @returns
 */
export function fetchAreaCourtStatistic() {
  return import("@/mock/getGlobalTreeData.json")
    .then((res) => res.default)
    .then((res) => res.data.areaCourtStatisticVo.children);
}

/**
 * 审判程序
 * @returns
 */
export function fetchTrialLevel() {
  return import("@/mock/getGlobalTreeData.json")
    .then((res) => res.default)
    .then((res) => res.data.trialLevel)
    .then((list) =>
      list.map((str: string) => ({
        value: str,
        label: str,
      }))
    );
}

/**
 * 文书类型
 * @returns
 */
export function fetchDocumentType() {
  return import("@/mock/getGlobalTreeData.json")
    .then((res) => res.default)
    .then((res) => res.data.documentType)
    .then((list) =>
      list.map((str: string) => ({
        value: str,
        label: str,
      }))
    );
}

/**
 * 效力级别
 * @returns
 */
export function fetchPotencyLevel() {
  return import("@/mock/getHighSearchContent.json")
    .then((res) => res.default)
    .then((res) => res.data.potencyLevel.children)
}

/**
 * 发文机关
 * @returns
 */
export function fetchIssuingOrgan() {
  return import("@/mock/getHighSearchContent.json")
    .then((res) => res.default)
    .then((res) => res.data.issuingOrgan.children)
}

/**
 * 时效性
 * @returns
 */
export function fetchTimeliness() {
  return import("@/mock/getHighSearchContent.json")
    .then((res) => res.default)
    .then((res) => res.data.timeliness)
    .then((list) =>
      list.map((str: string) => ({
        value: str,
        label: str,
      }))
    );
}
